package com.xsq;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class Constant {

	//本地POS基本配置信息 name
	public static final String CACHE_XSQ_POS = "CACHE_XSQ_POS";
	
	/********************************KEY******************************************/
	public static final String CACHE_UPDATE_ALERT = "CACHE_UPDATE_ALERT";
	
	public static final String CACHE_DEVICEID = "CACHE_DEVICEID";
	
	public static final String CACHE_PWD_SYSADMIN = "CACHE_PWD_SYSADMIN";
	public static final String CACHE_PWD_USER = "CACHE_PWD_USER";
	public static final String CACHE_SERVERINFO = "CACHE_SERVER_INFO";//上位机信息,JSON格式,支持多个服务器
	public static final String CACHE_POSNO = "CACHE_POSNO"; //逻辑号
	public static final String CACHE_WINNO = "CACHE_WINNO";//窗口号
	
	public static final String CACHE_WINNAME="CACHE_WINNAME";//窗口名称
	public static final String CACHE_MERCHANT="CACHE_MERCHANT";//商户
	
	public static final String CACHE_XFXX = "CACHE_XFXX";//POS机次消费限额
	
	public static final String CACHE_CONSUME_QUATO = "CACHE_CONSUME_QUATO";//是否定额消费
	public static final String CACHE_CONSUME_QUATO_MONEY = "CACHE_CONSUME_QUATO_MONEY";//定额消费金额
	
	public static final String CACHE_SYS_TITLE="CACHE_SYS_TITLE";
	
	public static final String CACHE_PRINT_TITLE="CACHE_PRINT_TITLE";
	
	/**
	 * 主要是打印机默认编码的问题引起
	 * 0 = 2016模式 默认GB2312
	 * 1 = 2017模式 默认Unicode
	 */
	public static final String CACHE_PRINTER_CODE = "CACHE_PRINTER_CODE";
	
	public static Map<String,String> PRINT_CODE_STR = new HashMap<String, String>();
	static{
		PRINT_CODE_STR.put("0", "GB2312");
		PRINT_CODE_STR.put("1", "Unicode");
	}
	
	/**
	 * 0=读取ID号（物理号）
	 * 1=M1卡,物理号和逻辑号
	 * 2=cpu卡
	 */
	public static final String CACHE_CARDTYPE="CACHE_CARDTYPE";
	//打印机打印方式 0=不打印 1=打印1张  2=打印2张
	public static final String CACHE_CONSUME_PRINT_MODE = "CACHE_CONSUME_PRINT_MODE";
	//消费密码明文密文 0=密文 1=明文
	public static final String CACHE_CONSUME_PWD_MODE = "CACHE_CONSUME_PWD_MODE";
	
	public static Map<String,String> CARD_READ_MODE = new HashMap<String,String>();
	static{
		CARD_READ_MODE.put("0", "ID卡");
		CARD_READ_MODE.put("1", "M1卡");
		CARD_READ_MODE.put("2", "CPU卡");
	}
	
	
	
	public static final String PAGE_FLAG_MAIN_INDEX = "PAGE_FLAG_MAIN_INDEX";//首页
	public static final String PAGE_FLAG_MAIN_CONSUME_MNG = "PAGE_FLAG_MAIN_CONSUME_MNG";//消费管理页面
	
	
	/************************************常量**********************************************/
	public static final String sysAdmin = "456789";//默认系统密码
	public static final  String userAdmin = "123456";//默认用户密码
	
	/**************************************默认线程池**********************************************/
	public static final ThreadPoolExecutor threadPoolExecutor   = new ThreadPoolExecutor(5,10, 5 * 60, TimeUnit.SECONDS,new LinkedBlockingDeque<Runnable>());
	
	/***************************************APP升级相关*************************************************/
	
	// apk保存到SD卡的路径
	public static final String savePath =  "/sdcard/updateAPK/"; 
	// 完整路径名
	public static final String saveFileName = savePath + "XSQ_POS.apk"; 
	
	
	public static final String publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCRtv6MVVasqOkJYPq6fVJA2HSn9LUDSC6m7c1VvQSlQH/iHoQhF7beBuZMMNYFvksLYkB64+7+rjYML7Tgv7kBQcqYgshHISqMjaB06Yl0zIt7ZFSM0gULRLmhscRhz9L0c13r+md9OIaWXCjLAYvSE2dJyxHv04YCAH7uQhL7LQIDAQAB";
	public static final String SIGNATURE_ALGORITHM = "MD5withRSA";
}
